package com.dowsure.apisaas.util;

import java.time.LocalDate;
import java.time.format.DateTimeFormatterBuilder;

/**
 * @description:
 * @create: 2022-02-25 17:57
 **/
public class DowsureDateUtils {

    public final static String YYYYMMDDHHMMSS = "yyyy-MM-dd HH:mm:ss";


    public static boolean validationFormat(String srcDate, String dateFormat){
        try {
            LocalDate.parse(srcDate, new DateTimeFormatterBuilder().appendPattern(dateFormat).parseStrict().toFormatter());
            return true;
        } catch (Exception e) {
            return false;
        }
    }

}
